<div class="wrapper wrapper-content animated fadeInRight">
    <!-- PAGE CONTENT BEGINS -->
    <div class="row">
        <div class="col-xs-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>搜索</h5>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="table-responsive">
                            <form class="form-search" method="get" action="<?=url('group.group/index')?>" role="form">
                                <table>
                                    <tr>
                                        <td>
                                            会员:
                                            <input id="username" type="text" name="username"  value="<?=input('get.username')?>" placeholder="请单击选择会员"  class="form-control"/>
                                            <input type="hidden" value="<?=$search['user_id']?>" name="user_id" id="user_id">
                                            <button id="show-btn1" style="display: none" type="button" mini="load" w="95%" h="95%" href="<?=url('miniapp/user.user/select')?>" class="btn btn-w-m btn-info">选择酒店</button>
                                            <script>
                                                $("#username").focus(function () {
                                                    $("#show-btn1").click();
                                                })
                                                function seleUser(user_name,user_id){
                                                    layer.closeAll();
                                                    layer.msg('操作成功！');
                                                    $("#username").val(user_name);
                                                    $("#user_id").val(user_id);
                                                }
                                            </script>
                                        </td>
                                        <td>开团日期:
                                            <input style="height: 34px;" value="<?=empty($search['date']) ? '' :$search['date'] ?>" placeholder="下单日期" name="date" id="decoration_time" class="laydate-icon form-control layer-date">
                                            <script>
                                                laydate({
                                                    elem: '#decoration_time',
                                                    event: 'focus',
                                                    format: 'YYYY-MM-DD',
                                                    istime: true
                                                });
                                            </script>
                                        </td>

                                        <td>状态:
                                            <select name="status" class="form-control">
                                                <option  <?=$search['status'] == 0 ? 'selected' : ''?> value="0" >请选择</option>
                                                <option <?=$search['status'] == 1 ? 'selected' : ''?> value="1" >等待开团</option>
                                                <option <?=$search['status'] == 2 ? 'selected' : ''?> value="2" >已开团</option>
                                                <option <?=$search['status'] == 3 ? 'selected' : ''?> value="3" >未成团</option>
                                            </select>
                                        </td>
                                        <td>
                                            <div class="input-group">
                                                <button type="submit" style="margin-top: 42%"
                                                        class="btn form-control btn-sm btn-primary">
                                                    搜索
                                                </button>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="ibox-content">
                <div class="row">
                    <div class="table-responsive">
                        <table id="simple-table" class="table table-striped">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>商品</th>
                                <th>过期时间</th>
                                <th>团长</th>
                                <th>该团需要人数</th>
                                <th>当前参团人数</th>
                                <th>开团时间</th>
                                <th>状态</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <form id="mini_list">
                                <tbody>
                                <?php foreach($list as $val){ ?>
                                <tr>
                                    <td><?=$val->group_id ?></td>
                                    <td><textarea><?=empty($goods[$val->goods_id]) ? '' : $goods[$val->goods_id]->goods_name?></textarea></td>
                                    <td><?=date("Y-m-d H:i:s",$val->expire_time)?></td>
                                    <td><?=empty($user[$val->user_id]) ? '' :$user[$val->user_id]->nick_name?></td>
                                    <td><?=$val->max_num?>人</td>
                                    <td><?=$val->this_num?>人</td>
                                    <td><?=date("Y-m-d H:i:s",$val->add_time)?></td>
                                    <td>
                                        <?php if($val->status == 0 )  { ?>
                                        <span class="label label-success">等待拼团</span>
                                        <?php }elseif($val->status == 1) { ?>
                                        <span class="label label-success">已成团</span>
                                        <?php }elseif($val->expire_time < time() ) { ?>
                                        <span class="label label-success">已成团</span>
                                        <?php }elseif($val->status == 8) { ?>
                                        <?php } ?>
                                    </td>
                                    <td>
                                        <div class="hidden-sm hidden-xs btn-group">
                                            <a title="查看订单成员"  href="<?=url('group.order/index','group_id='.$val->group_id)?>" class="btn btn-xs btn-info">查看订单成员</a>
                                            <?php if($val->status != 1) { ?>
                                            <a title="一键成团是指 在没有成团的情况下 后台主动成团 确定要一键成团吗？"  mini="act" href="<?=url('group.group/yjct','group_id='.$val->group_id)?>" class="btn btn-xs btn-default">一键成团</a>
                                            <?php } ?>
                                            <a title="删除开团抢购" mini="act" href="<?=url('group.group/delete','group_id='.$val->group_id)?>" class="btn btn-xs btn-warning"><i class="fa fa-trash bigger-120"></i>删除</a>
                                        </div>
                                    </td>
                                </tr>
                                <?php } ?>
                                </tbody>
                            </form>
                        </table>
                        <div>
                            <?php echo $page; ?>
                        </div>
                    </div><!-- /.row -->
                </div><!-- /.main-container -->
            </div>
        </div>
    </div>
</div>
